package com.ccys.db.enums;

import com.ccys.common.enums.CodeEnum;

/**
 * @ClassName: FamilyRelationEnum
 * @Description:
 * @Author: billyhu
 * @Date: 2024/2/21 11:45
 */
public enum FamilyRelationEnum {

    CHILD(0,"Child"),
    WIFE(1,"Wife"),
    HUSBAND(2,"Husband"),
    BROTHER(3,"Brother"),
    SISTER(4,"Sister"),
    FATHER(5,"Father"),
    MOTHER(6,"Mother"),
    SON(7,"Son"),
    DAUGHTER(8,"Daughter"),
    DOMESTIC_HELPER(9,"Domestic helper"),
    GRANDFATHER(10,"Grandfather"),
    GRANDMOTHER(11,"Grandmother"),
    OTHERS(12,"Others")
    ;


    private Integer key;
    private String value;

    FamilyRelationEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getRelation(Integer key) {
        for (FamilyRelationEnum fre : values()) {
            if (fre.getKey() == key) {
                return fre.getValue();
            }
        }
        return null;
    }
}

